package com.ty.day4;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * Author : txy
 * Create 2023/10/31 17:21
 */
public class Ten {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个大于2的偶数: ");
        int x = sc.nextInt();
        if (x == 2 || x % 2 == 1) {
            System.out.println("输入的不是偶数或者输入的是2");
            return;
        }
        for (int i = 2; i <= x / 2; i++) {
            if (Prime(i) && Prime(x - i)) {
                System.out.println(x + "=" + i + "+" + (x - i));
//                break;
            }
        }
    }

    public static boolean Prime(int a) {
        if (a <= 1) {
            return true;
        }
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
}
